/*                   _   _ _ __                               *\
**     ________ ___ | | | | '_ \   scaup - Scala up!          **
**    / __/ __// _ || | | | |_) |  (c) 2008, Normen Mueller   **
**  __\ \/ /__/ __ || |_| | .__/   http://kwarc.info.nmueller **
** /____/\___/_/ |_/ \__,_|_|                                 **
**                                                            **
\*                                                            */
  
// $Id: AbstractReporter.scala 9 2008-05-24 12:12:30Z normen.mueller $

/* This class has its origin at: scala.tools.nsc.reporters.AbstractReporter */

package scaup.reporter

/** This reporter implements filtering. */
abstract class AbstractReporter extends Reporter {
  val settings: Settings

  def display(msg: String, severity: Severity): Unit
  def displayPrompt: Unit

  protected def info0(msg: String, severity: Severity, force: Boolean) {
    severity match {
      case INFO    => if (force || settings.verbose.value) display(msg, severity)
      case WARNING =>
        if (!settings.nowarnings.value) {
          display(msg, severity)
          if (settings.prompt.value) displayPrompt
        }
      case ERROR => {
        display(msg, severity)
        if (settings.prompt.value) displayPrompt
      }
    }
  }
}
